<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>事件</title>
</head>
<body>
    <img id="01" src="src/img/01.png"/>
    <br>
<button id="start" onclick="start()">上一张</button>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<button id="end" onclick="end()">下一张</button>
</body>

<script>
    <!--显示第一张图片-->
    function start() {
        let abc = document.getElementById("01");
        abc.setAttribute("src","src/img/01.png");
    }
/*第二张*/
    function end() {
        let bbc = document.getElementById("01");
        bbc.setAttribute("src","src/img/02.png")
    }

    let startBtn = document.getElementById("start");
    startBtn.onclick=start;

    let endBtn = document.getElementById("end");
    endBtn.onclick=end;
</script>
</html>